<template>
  <van-search  @click="onClickButton"  show-action placeholder="请输入搜索关键词">
    <template #action>
      <div>搜索</div>
    </template>
    <template #label>
      <div @click="onCliclabel">地址</div>
    </template>
  </van-search>
 
</template>

<script lang="ts" setup>
import { computed } from "vue";
import { useRouter, useRoute } from "vue-router";

// 调用 useRouter() 函数，就可以获取到路由对象实例
const router = useRouter();

// 当前路由信息
const route = useRoute();

// 当前页面的标题信息: 根据当前激活的路由信息获取 meta 元数据中配置的 title
const title = computed(() => route.meta?.title ?? "默认标题");

/**
 * 编程式的导航: 后退
 */
const handleBack = () => {
  router.back();
  // window.history.back()
};
const onClickButton = () => {
  router.push("/Search");
};
</script>

<style lang="less" scoped>
</style>
